package com.zb.yaml;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 短信密钥
 * @Author WEN
 * @Date 2023/9/14 0014
 **/
@Component
public class SmsSecret {
    @Value("${aliyun.sms.AccessKeyId}")
    private String accessKeyId;
    @Value("${aliyun.sms.AccessKeySecret}")
    private String secret;
    @Value("${aliyun.sms.domain}")
    private String domain;
    @Value("${aliyun.sms.version}")
    private String version;
    @Value("${aliyun.sms.action}")
    private String action;

    private static SmsSecret smsSecret;

    @PostConstruct
    public void init() {
        smsSecret = this;
        smsSecret.accessKeyId = this.accessKeyId;
        smsSecret.secret = this.secret;
        smsSecret.domain = this.domain;
        smsSecret.version = this.version;
        smsSecret.action = this.action;
    }

    public static String accessKeyId() {
        return smsSecret.accessKeyId;
    }

    public static String secret() {
        return smsSecret.secret;
    }

    public static String domain() {
        return smsSecret.domain;
    }

    public static String version() {
        return smsSecret.version;
    }

    public static String action() {
        return smsSecret.action;
    }
}
